package com.ccit.common.client;

import com.ccit.common.feign.FeignConfiguration;
import com.ccit.model.Area;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Repository
@FeignClient(name="service-area", configuration = FeignConfiguration.class)
public interface AreaClient {

//    @PutMapping("/area/updateAreaCurrentPerson/{name}/{num}")
//    boolean updateAreaPersonNumByName(@PathVariable String name,
//                                      @PathVariable Integer num);
    @RequestMapping(value = "/area/updateAreaCurrentPerson/{name}/{num}", method = RequestMethod.PUT)
    boolean updateAreaPersonNumByName(@PathVariable String name,
                                      @PathVariable Integer num);

//    @GetMapping("api/area/getById/{areaId}")
//    Area getById(@PathVariable Long areaId);
    @RequestMapping(value = "api/area/getById/{areaId}", method = RequestMethod.GET)
    Area getById(@PathVariable Long areaId);

//    @GetMapping("api/area/getByName/{areaName}")
//    Area getByName(@PathVariable String areaName);
    @RequestMapping(value = "api/area/getByName/{areaName}", method = RequestMethod.GET)
    Area getByName(@PathVariable String areaName);

}
